use super::crypt_types::{CRYPT_EAL_LibCtx, CRYPT_EncodeParam};
use super::crypt_eal_pkey::CRYPT_EAL_PkeyCtx;
use crate::bsl::bsl_params::BSL_Param;
use crate::bsl::bsl_types::BSL_Buffer;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CRYPT_DecoderCtx {
    _unused: [u8; 0],
}
pub type CRYPT_DECODER_Ctx = CRYPT_DecoderCtx;
unsafe extern "C" {
    pub fn CRYPT_DECODE_ProviderNewCtx(
        libCtx: *mut CRYPT_EAL_LibCtx,
        keyType: i32,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut CRYPT_DECODER_Ctx;
}
unsafe extern "C" {
    pub fn CRYPT_DECODE_Free(ctx: *mut CRYPT_DECODER_Ctx);
}
unsafe extern "C" {
    pub fn CRYPT_DECODE_SetParam(ctx: *mut CRYPT_DECODER_Ctx, param: *const BSL_Param) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_DECODE_GetParam(ctx: *mut CRYPT_DECODER_Ctx, param: *mut BSL_Param) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_DECODE_Decode(
        ctx: *mut CRYPT_DECODER_Ctx,
        inParam: *const BSL_Param,
        outParam: *mut *mut BSL_Param,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_DECODE_FreeOutData(ctx: *mut CRYPT_DECODER_Ctx, outData: *mut BSL_Param);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CRYPT_DECODER_PoolCtx {
    _unused: [u8; 0],
}
pub const SET_TARGET_FORMAT: CRYPT_DECODE_POOL_CMD = 0;
pub const SET_TARGET_TYPE: CRYPT_DECODE_POOL_CMD = 1;
pub const CRYPT_DECODE_POOL_CMD_CRYPT_DECODE_POOL_CMD_SET_FLAG_FREE_OUT_DATA:
    CRYPT_DECODE_POOL_CMD = 2;
pub type CRYPT_DECODE_POOL_CMD = ::std::os::raw::c_uint;
unsafe extern "C" {
    pub fn CRYPT_DECODE_PoolNewCtx(
        libCtx: *mut CRYPT_EAL_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        keyType: i32,
        format: *const ::std::os::raw::c_char,
        type_: *const ::std::os::raw::c_char,
    ) -> *mut CRYPT_DECODER_PoolCtx;
}
unsafe extern "C" {
    pub fn CRYPT_DECODE_PoolFreeCtx(poolCtx: *mut CRYPT_DECODER_PoolCtx);
}
unsafe extern "C" {
    pub fn CRYPT_DECODE_PoolDecode(
        poolCtx: *mut CRYPT_DECODER_PoolCtx,
        inParam: *const BSL_Param,
        outParam: *mut *mut BSL_Param,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_DECODE_PoolCtrl(
        poolCtx: *mut CRYPT_DECODER_PoolCtx,
        cmd: i32,
        val: *mut ::std::os::raw::c_void,
        valLen: i32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_DecodeBuffKey(
        format: i32,
        type_: i32,
        encode: *mut BSL_Buffer,
        pwd: *const u8,
        pwdlen: u32,
        ealPKey: *mut *mut CRYPT_EAL_PkeyCtx,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_ProviderDecodeBuffKey(
        libCtx: *mut CRYPT_EAL_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        keyType: i32,
        format: *const ::std::os::raw::c_char,
        type_: *const ::std::os::raw::c_char,
        encode: *mut BSL_Buffer,
        pwd: *const BSL_Buffer,
        ealPKey: *mut *mut CRYPT_EAL_PkeyCtx,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_DecodeFileKey(
        format: i32,
        type_: i32,
        path: *const ::std::os::raw::c_char,
        pwd: *mut u8,
        pwdlen: u32,
        ealPKey: *mut *mut CRYPT_EAL_PkeyCtx,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_ProviderDecodeFileKey(
        libCtx: *mut CRYPT_EAL_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        keyType: i32,
        format: *const ::std::os::raw::c_char,
        type_: *const ::std::os::raw::c_char,
        path: *const ::std::os::raw::c_char,
        pwd: *const BSL_Buffer,
        ealPKey: *mut *mut CRYPT_EAL_PkeyCtx,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_EncodeBuffKey(
        ealPKey: *mut CRYPT_EAL_PkeyCtx,
        encodeParam: *const CRYPT_EncodeParam,
        format: i32,
        type_: i32,
        encode: *mut BSL_Buffer,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_ProviderEncodeBuffKey(
        libCtx: *mut CRYPT_EAL_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        ealPKey: *mut CRYPT_EAL_PkeyCtx,
        encodeParam: *const CRYPT_EncodeParam,
        format: *const ::std::os::raw::c_char,
        type_: *const ::std::os::raw::c_char,
        encode: *mut BSL_Buffer,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_EncodeFileKey(
        ealPKey: *mut CRYPT_EAL_PkeyCtx,
        encodeParam: *const CRYPT_EncodeParam,
        format: i32,
        type_: i32,
        path: *const ::std::os::raw::c_char,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_ProviderEncodeFileKey(
        libCtx: *mut CRYPT_EAL_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        ealPKey: *mut CRYPT_EAL_PkeyCtx,
        encodeParam: *const CRYPT_EncodeParam,
        format: *const ::std::os::raw::c_char,
        type_: *const ::std::os::raw::c_char,
        path: *const ::std::os::raw::c_char,
    ) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __locale_data {
    pub _address: u8,
}
